﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RoadTeam.Model.Base
{
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
    public sealed class ColumnAttribute : Attribute
    {
        public ColumnAttribute() { }
       
        private bool _canBeNull; 
        /// <summary>
        /// 能否为空
        /// </summary>
        public bool CanBeNull
        {
            get { return _canBeNull; }
            set { _canBeNull = value; }
        }

        private bool _identity;
        /// <summary>
        /// 是否自动增长
        /// </summary>
        public bool Identity
        {
            get { return _identity; }
            set { _identity = value; }
        }

        private String _columName;
        /// <summary>
        /// 列名
        /// </summary>
        public String ColumnName
        {
            get { return _columName; }
            set { _columName = value; }
        }

        private String _dbType;
        /// <summary>
        /// 数据库类型
        /// </summary>
        public String DbType
        {
            get { return _dbType; }
            set { _dbType = value; }
        }

        private Int32 _length;
        /// <summary>
        /// 数据库类型
        /// </summary>
        public Int32 Length
        {
            get { return _length; }
            set { _length = value; }
        }
        private Boolean _isPrimaryKey;
        /// <summary>
        /// 是否主键
        /// </summary>
        public Boolean IsPrimaryKey
        {
            get { return _isPrimaryKey; }
            set { _isPrimaryKey = value; }
        }
        private String _description;
        /// <summary>
        /// 列描述
        /// </summary>
        public String Description
        {
            get { return _description; }
            set { _description = value; }
        }
    }
}
